<template>
  <div>
    <el-table
      height="500"
      v-loading="listLoading"
      :data="list"
      highlight-current-row
    >
      <el-table-column
        label="培训名称"
        prop="trainName"
        min-width="200"
        sortable
      />
      <el-table-column label="培训内容" prop="content" width="150px" sortable />
      <el-table-column label="申请人" prop="createUserName" min-width="100px" align="center" />
      <el-table-column
        label="培训总结内容"
        prop="sumContent"
        min-width="200px"
        
      />

      <!-- <el-table-column label="当前阶段" prop="phaseName" width="100px" />
          <el-table-column
            label="更新时间"
            prop="accessTimeString"
            width="150px"
          /> -->
      <el-table-column label="操作" align="center" width="60" fixed="right">
        <template slot-scope="{ row }">
          <el-dropdown trigger="click" class="filter-item">
            <el-button type="text"><i class="el-icon-more" /></el-button>
            <el-dropdown-menu slot="dropdown" class="user-dropdown">
              <!-- <el-dropdown-item @click.native.prevent="preview(row)"
                    >查看</el-dropdown-item
                  > -->
              <el-dropdown-item @click.native.prevent="handle(row)"
                >处理</el-dropdown-item
              >
            </el-dropdown-menu>
          </el-dropdown>
        </template>
      </el-table-column>
    </el-table>

    <pagination
      v-show="total > 0"
      :total="total"
      :page-number.sync="listQuery.pageNumber"
      :page-size.sync="listQuery.pageSize"
      @pagination="getList"
    />
  <SumUp :sumUpData='sumUpData' @getList='getList'></SumUp>
  </div>
</template>

<script>
import Pagination from '@/components/Pagination'

import { pageTodo, listNode } from '@/api/ts/train.js'
import SumUp from '@/views/train/train_list_manage/sumUp/index.vue'




export default {
  components: { Pagination, SumUp },
  data() {
    return {
      listQuery: {
        pageNumber: 1,
        pageIndex: 0,
        pageSize: 10
      },
      list: [],
      total: 10,
      listLoading: false,
      path: {},
      dialogVisible: false,
      radio: '',
      temp: {},
      reason: '',
      sumUpData:''
    }
  },
  mounted() {
    this.getList()
  },
  methods: {
    //   分页
    getList() {
      this.listLoading = true
      this.listQuery.pageIndex = this.listQuery.pageNumber - 1
      pageTodo(this.listQuery)
        .then((res) => {
          this.list = res.data.rows
          this.total = res.data.total
          this.$store.commit('message/SUM_UP_COUNT', res.data.total)
        })
        .finally(() => {
          this.listLoading = false
        })
    },
    handle(row) {
              this.sumUpData={
         dialogVisible:true,
         row:row
       }
    }
  }
}
</script>

<style scoped >
/* .my-table {

}
/deep/.el-table  {
    padding: 22px;
  } */
</style>
